import { toast } from 'sonner';

// 成功提示的统一样式配置
export const successToast = (message: string, options?: any) => {
  return toast.success(message, {
    duration: 1000,
    position: 'top-center',
    style: {
      background: 'linear-gradient(135deg, #10b981, #059669)',
      color: 'white',
      border: 'none',
      borderRadius: '12px',
      boxShadow: '0 10px 25px rgba(16, 185, 129, 0.3)',
      fontSize: '14px',
      fontWeight: '500',
      padding: '12px 16px',
      minWidth: '300px',
      textAlign: 'center',
      animation: 'fadeOut 1s ease-in-out 1s forwards'
    },
    icon: '✅',
    ...options
  });
};

// 错误提示的统一样式配置
export const errorToast = (message: string, options?: any) => {
  return toast.error(message, {
    duration: 1000,
    position: 'top-center',
    style: {
      background: 'linear-gradient(135deg, #ef4444, #dc2626)',
      color: 'white',
      border: 'none',
      borderRadius: '12px',
      boxShadow: '0 10px 25px rgba(239, 68, 68, 0.3)',
      fontSize: '14px',
      fontWeight: '500',
      padding: '12px 16px',
      minWidth: '300px',
      textAlign: 'center',
      animation: 'fadeOut 1s ease-in-out 1s forwards'
    },
    icon: '❌',
    ...options
  });
};

// 信息提示的统一样式配置
export const infoToast = (message: string, options?: any) => {
  return toast.info(message, {
    duration: 1000,
    position: 'top-center',
    style: {
      background: 'linear-gradient(135deg, #3b82f6, #2563eb)',
      color: 'white',
      border: 'none',
      borderRadius: '12px',
      boxShadow: '0 10px 25px rgba(59, 130, 246, 0.3)',
      fontSize: '14px',
      fontWeight: '500',
      padding: '12px 16px',
      minWidth: '300px',
      textAlign: 'center',
      animation: 'fadeOut 1s ease-in-out 1s forwards'
    },
    icon: 'ℹ️',
    ...options
  });
};

// 警告提示的统一样式配置
export const warningToast = (message: string, options?: any) => {
  return toast.warning(message, {
    duration: 1000,
    position: 'top-center',
    style: {
      background: 'linear-gradient(135deg, #f59e0b, #d97706)',
      color: 'white',
      border: 'none',
      borderRadius: '12px',
      boxShadow: '0 10px 25px rgba(245, 158, 11, 0.3)',
      fontSize: '14px',
      fontWeight: '500',
      padding: '12px 16px',
      minWidth: '300px',
      textAlign: 'center',
      animation: 'fadeOut 1s ease-in-out 1s forwards'
    },
    icon: '⚠️',
    ...options
  });
}; 